home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / amos / localext.lha / locale_ext / locale / LocDemo.AMOS / LocDemo.amosSourceCode
AMOS Source Code  |  1994-04-06  |  3KB  |  115 lines

  1. ' **************************** 
  2. ' *                          * 
  3. ' *   Locale Extension Demo  * 
  4. ' * Written by Johan ï¿½stling * 
  5. ' *                          * 
  6. ' **************************** 
  7. '
  8. ' NOTE: The first part of this demo runs without 
  9. '       locale library 
  10. '
  11. ' Open Catalog "catalog name","builtin language" 
  12. '
  13. '  "catalog name" must be a string containing the catalog name 
  14. '                 and ending with .catalog 
  15. '  "builtin language" is the language built into the program.  
  16. '                     This can be an empty string if you wish. 
  17. '
  18.  Extension_17_007C "locdemo.catalog","english"
  19. MESSAGES=13
  20. Dim MESS$(MESSAGES)
  21. For I=1 To MESSAGES
  22.    Read A,A$ : MESS$(I)= Extension_17_0064(A,A$)
  23. Next I
  24. '
  25. ' I could do 'Close Catalog' here, since I copied all strings, 
  26. ' but I wish to check for the catalog later on, so I leave it
  27. ' open.
  28. '
  29. Screen Open 0,640,200,4,Hires
  30. Pen 2 : Paper 0 : Curs Off : Flash Off : Cls 
  31. Palette 0,$F00,$F0,$F
  32. Centre MESS$(1) : Print : Print 
  33. '
  34. ' Locale Active returns non-zero if locale library is present. 
  35. '  
  36. If Extension_17_00B2 
  37.    '
  38.    ' Catalog Active returns non-zero if user's preferred language 
  39.    ' is loaded
  40.    '
  41.    If Extension_17_00C6 
  42.       Centre MESS$(2)
  43.    Else 
  44.       Centre "I could not find your language. Maybe it is built in?"
  45.    End If 
  46. Else 
  47.    Centre "I'm sorry but you don't have locale library."
  48. End If 
  49. Print : Centre MESS$(3)
  50. Wait Key 
  51. '
  52. ' Now, the following functions require locale.library  
  53. '
  54. If Extension_17_00B2 =0
  55.    Print : Print : Pen 3
  56.    Centre "I'm sorry, but the following functions require locale library"
  57.    End 
  58. End If 
  59. '
  60. ' Now, test some string manipulation functions 
  61. '
  62. STRINGFUNCS:
  63. Cls : Pen 2 : Print MESS$(4) : Pen 1 : Input A$
  64. Pen 3 : Print : Print MESS$(6) : Pen 1 : Print Extension_17_001A(A$)
  65. Pen 3 : Print : Print MESS$(7) : Pen 1 : Print Extension_17_0006(A$)
  66. Pen 2 : Print : Print MESS$(5) : Pen 1 : Input B$
  67. RESULT= Extension_17_010A(A$,B$)
  68. Print : Print A$;" "; : Pen 2
  69. If RESULT<0 Then Print MESS$(8);
  70. If RESULT>0 Then Print MESS$(9);
  71. If RESULT=0 Then Print MESS$(10);
  72. Pen 1 : Print " ";B$
  73. '
  74. ' 39 and 40 for Locale String is Yes / No replies
  75. '
  76. YES$= Extension_17_004E(39) : NO$= Extension_17_004E(40)
  77. QUESTION:
  78. Pen 3 : Print : Print MESS$(11);" ( ";YES$;" / ";NO$;" ) ";
  79. Pen 1 : Input A$
  80. If Extension_17_003E(Asc(YES$))= Extension_17_003E(Asc(A$)) Then Goto STRINGFUNCS
  81. If Extension_17_003E(Asc(NO$))<> Extension_17_003E(Asc(A$)) Then Goto QUESTION
  82. '
  83. ' Multi clocks 
  84. '
  85. Cls : Pen 2 : Centre MESS$(12) : Print : Centre MESS$(3) : Pen 1
  86. Curs Off 
  87. While Inkey$<>"" : Wend : Rem Remove any pending characters
  88. While Inkey$=""
  89.    Locate 0,4
  90.    Print Extension_17_0142 
  91.    Print Extension_17_014E 
  92.    Print Extension_17_015A 
  93.    Print Extension_17_016A 
  94.    Print Extension_17_017C 
  95.    Print Extension_17_018E 
  96.    Wait Vbl 
  97. Wend 
  98. Pen 3 : Print : Print : Centre MESS$(13)
  99.  Extension_17_009E 
  100. End 
  101.  
  102. Rem Messages 
  103. Data 1,"Welcome to AMOS Locale Extension Demo"
  104. Data 2,"This string is in one of your preferred languages!"
  105. Data 3,"Press any key to go on..."
  106. Data 4,"Input a string:"
  107. Data 5,"Input another string:"
  108. Data 6,"Make string uppercase:"
  109. Data 7,"Make string lowercase:"
  110. Data 8,"is less than"
  111. Data 9,"is greater than"
  112. Data 10,"is equal to"
  113. Data 11,"Do you want to try this again?"
  114. Data 12,"Central Clock Room"
  115. Data 13,"That was all."